// 云函数入口文件
const cloud = require('wx-server-sdk')
const getTimeTable = require("./getTimeTable/index")
const getMyTimeTable = require("./getTimeTable/index")
const setTimeTable = require("./setTimeTable/index")
const checkTimeTable = require("./checkTimeTable/index")
const getMaxTimeTable = require("./getMaxTimeTable/index")
const setOpen = require("./setOpen/index")
// 云函数入口函数
exports.main = async (event, context) => {
  switch(event.type){
    case "getMyTimeTable":
      return await getTimeTable.main(event,context)
    case "getTimeTable":
      return await getTimeTable.main(event,context)
    case "setOpen":
      return await setOpen.main(event,context)
    case "setTimeTable":
      return await setTimeTable.main(event,context)
    case "checkTimeTable":
      return await checkTimeTable.main(event,context)
    case "getMaxTimeTable":
      return await getMaxTimeTable.main(event,context)
  }
  return {
    code:400,
    data:{},
    msg:"type error"
  }
  
}